package network;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class Test01 {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress addresses = InetAddress.getByName("192.168.41.57");

        String hostName = addresses.getHostName();
        String hostAddress = addresses.getHostAddress();

        System.out.println("主机名：" +hostName+"\tIP地址："+hostAddress);
    }
}
